#include <bits/stdc++.h>
using namespace std;

const int N = 100010;

int n, s, p, q;
vector<int> g[N];

int main() {
    freopen("nim.in", "r", stdin);
    freopen("nim.out", "w", stdout);

    scanf("%d%d%d%d", &n, &s, &p, &q);
    for (int i = 1; i <= n - 1; i++) {
        int u, v; scanf("%d%d", &u, &v);
        g[u].push_back(v);
    }
    if (q >= p) {
        printf("1\n"); return 0;
    }
    return 0;
}